package hud;

import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.scene.control.SplitPane;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;


public class UI implements ChangeListener<Number> {
    public SplitPane splitPane;
    public double currentValue = 0.1;

    public UI() {
    }

    public VBox init() {
        VBox vBox = new VBox();

        //1. menubar
        vBox.getChildren().add(Menu.create());

        //2. borderpane
        BorderPane borderPane = new BorderPane();
        borderPane.setTop(Toolbar.create());
        splitPane = SplitView.instance().init(vBox);
        borderPane.setLeft(splitPane);

        vBox.getChildren().add(borderPane);

        //3. statusbar
        HBox hBox = new Statusbar().Init();
        vBox.getChildren().add(hBox);

        return vBox;
    }

    @Override
    public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
//        splitPane.setDividerPosition(0, currentValue);
    }
}